﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Method.Returns.Is
{
    [TestClass]
    public class NullAttributeTest
    {
        [Arcana.Contract.Method.Returns.Is.Null]
        public static string Target_1()
        {
            return null;
        }

        [Arcana.Contract.Method.Returns.Is.Null]
        public static string Target_2()
        {
            return "Hello World!";
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(55)]
        [ExpectedException(typeof(InvalidOperationException))]
        public void ShouldThrowException()
        {
            Target_2();
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(55)]
        public void ShouldPass()
        {
            Target_1();
        }
    }
}
